package sutl

import (
	"gitee.com/xiakai001/goutl/constraints"
	"gitee.com/xiakai001/goutl/goutl"
)

func ParseArrToExist[K comparable](arr []K) map[K]bool {

	existMap := make(map[K]bool, len(arr))
	for _, a := range arr {
		existMap[a] = true
	}

	return existMap
}

func ParseArrIntToArrStr[V constraints.Integer](arr []V) []string {
	return goutl.ParseArrToArr(arr, goutl.ParseIntToStr[V])
}

func ParseArrStrToArrInt(arr []string) []int64 {
	return goutl.ParseArrToArr(arr, goutl.ParseStrToInt[int64])
}
